/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ui.admin.student;

import java.util.ArrayList;
import java.util.List;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;

/**
 *
 * @author QuynhDu
 */
@ManagedBean
@RequestScoped
public class StudentStatus {

    /**
     * e a new instance of StudentStatus
     */
    int value;
    String display;
    
    public StudentStatus() {
    }

    public int getValue() {
        return value;
    }

    public void setValue(int value) {
        this.value = value;
    }

    public String getDisplay() {
        return display;
    }

    public void setDisplay(String display) {
        this.display = display;
    }

    public StudentStatus(int value, String display) {
        this.value = value;
        this.display = display;
    }
    
    /**
     * @return List<Genders>
     * @see list of genders in a combobox
     */
    public List<Genders> getAll(){
        ArrayList<Genders> listG = new ArrayList<Genders>();
        listG.add(new Genders(true, "Male"));
        listG.add(new Genders(false, "Female"));
        return listG;
    }
    /**
     * @return String
     * @see display genders in the form of string
     */
    public String getDisplay(boolean val){
        for (Genders object : getAll()) {
            if (object.getValue() == val) {
                return object.getDispayString();
            }
        }
        return "error gender";
    }
}
